﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ARSoft.Tools.Net.Dns;

namespace DnsProxy.Playground
{
    class Program
    {
        static void Main(string[] args)
        {
            var clnt = new DnsClient(System.Net.IPAddress.Parse("208.67.220.220"), 1000);

            var srv = new ARSoft.Tools.Net.Dns.DnsServer(100, 100, (query, clientAddress, protocolType) => {
                var result = clnt.SendMessage(query as DnsMessage);
                if (result == null)
                    return null;

                foreach (var item in (result as DnsMessage).AnswerRecords)
                {
                    Console.WriteLine(item);
                }

                return result;
            });
            srv.Start();

            Console.WriteLine("working");
            Console.ReadLine();
        }
    }
}
